import { request } from "@/utils/service"
import type * as Carousel from "./types/carousel"

/** 增 */
export function createCarouselDataApi(data: Carousel.CreateOrUpdateCarouselRequestData) {
  return request({
    url: "image",
    method: "post",
    data
  })
}

/** 删 */
export function deleteCarouselDataApi(ids: string) {
  return request({
    url: `image/batch?ids=${ids}`,
    method: "delete"
  })
}

// /** 改 */
export function updateCarouselDataApi(data: Carousel.CreateOrUpdateCarouselRequestData) {
  return request({
    url: "image",
    method: "put",
    data
  })
}

/** 查 */
export function getCarouselDataApi(params: Carousel.GetCarouselRequestData) {
  return request<Carousel.GetCarouselResponseData>({
    url: "image",
    method: "get",
    params
  })
}
